class TextDialogDisplay(DialogDisplay):
    def __init__(self, file, height, width):
        l = []
        # read the whole file (being slow, not lazy this time)
        for line in open(file).readlines():
            l.append( urwid.Text( line.rstrip() ))
        body = urwid.ListBox(l)
        body = urwid.AttrWrap(body, 'selectable','focustext')

        DialogDisplay.__init__(self, None, height, width, body)


    def unhandled_key(self, size, k):
        if k in ('up','page up','down','page down'):
            self.frame.set_focus('body')
            self.view.keypress( size, k )
            self.frame.set_focus('footer')

